package com.education.user.service;


import com.education.user.mapper.SysCommentMapper;
import com.education.user.pojo.SysComment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 咨询评论 服务层
 *
 * @author d
 * @date 2020-03-24
 */

@Service
public class ISysCommentService {

    @Autowired
    private SysCommentMapper sysCommentMapper;

    /**
     * 查询所有评论总数
     * @return
     */
    public Integer count(){
       return sysCommentMapper.selectCount(null);
    }

    /**
     * 根据资讯id查询评论
     */
    public List<SysComment> selectById(Integer id) {
        SysComment sysComment = new SysComment();
        sysComment.setsInformationid(id);
        List<SysComment> select = sysCommentMapper.select(sysComment);
        return select;
    }
}